using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ImageAnalystTools._Statistical
{
    /// <summary>
    /// <para>Cell Statistics</para>
    /// <para>Calculates a per-cell statistic from multiple rasters.</para>
    /// <para>计算来自多个栅格的每像元统计数据。</para>
    /// </summary>    
    [DisplayName("Cell Statistics")]
    public class CellStatistics : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public CellStatistics()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_rasters_or_constants">
        /// <para>Input rasters or constant values</para>
        /// <para><xdoc>
        ///   <para>A list of input rasters for which a statistic will be calculated for each cell in the Analysis window.</para>
        ///   <para>A number can be used as an input; however, the cell size and extent must first be set in the environment.</para>
        ///   <para>If the Process as multiband parameter is checked, all multiband inputs must have an equal number of bands.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入栅格列表，将为其在分析窗口中的每个像元计算统计数据。</para>
        ///   <para>数字可以用作输入;但是，必须首先在环境中设置像元大小和范围。</para>
        ///   <para>如果选中“作为多波段处理”参数，则所有多波段输入必须具有相等数量的波段。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_raster">
        /// <para>Output raster</para>
        /// <para><xdoc>
        ///   <para>The output raster.</para>
        ///   <para>For each cell, the value is determined by applying the specified statistic type to the input rasters at that location.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出栅格。</para>
        ///   <para>对于每个像元，通过将指定的统计数据类型应用于该位置的输入栅格来确定该值。</para>
        /// </xdoc></para>
        /// </param>
        public CellStatistics(List<object> _in_rasters_or_constants, object _out_raster)
        {
            this._in_rasters_or_constants = _in_rasters_or_constants;
            this._out_raster = _out_raster;
        }
        public override string ToolboxName => "Image Analyst Tools";

        public override string ToolName => "Cell Statistics";

        public override string CallName => "ia.CellStatistics";

        public override List<string> AcceptEnvironments => ["autoCommit", "cellSize", "cellSizeProjectionMethod", "compression", "configKeyword", "extent", "geographicTransformations", "mask", "outputCoordinateSystem", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_rasters_or_constants, _out_raster, _statistics_type.GetGPValue(), _ignore_nodata.GetGPValue(), _process_as_multiband.GetGPValue()];

        /// <summary>
        /// <para>Input rasters or constant values</para>
        /// <para><xdoc>
        ///   <para>A list of input rasters for which a statistic will be calculated for each cell in the Analysis window.</para>
        ///   <para>A number can be used as an input; however, the cell size and extent must first be set in the environment.</para>
        ///   <para>If the Process as multiband parameter is checked, all multiband inputs must have an equal number of bands.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入栅格列表，将为其在分析窗口中的每个像元计算统计数据。</para>
        ///   <para>数字可以用作输入;但是，必须首先在环境中设置像元大小和范围。</para>
        ///   <para>如果选中“作为多波段处理”参数，则所有多波段输入必须具有相等数量的波段。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input rasters or constant values")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _in_rasters_or_constants { get; set; }


        /// <summary>
        /// <para>Output raster</para>
        /// <para><xdoc>
        ///   <para>The output raster.</para>
        ///   <para>For each cell, the value is determined by applying the specified statistic type to the input rasters at that location.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出栅格。</para>
        ///   <para>对于每个像元，通过将指定的统计数据类型应用于该位置的输入栅格来确定该值。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_raster { get; set; }


        /// <summary>
        /// <para>Overlay statistic</para>
        /// <para><xdoc>
        ///   <para>Specifies the statistic type to be calculated.</para>
        ///   <bulletList>
        ///     <bullet_item>Mean—The mean (average) of the inputs will be calculated.</bullet_item><para/>
        ///     <bullet_item>Majority—The majority (value that occurs most often) of the inputs will be calculated.</bullet_item><para/>
        ///     <bullet_item>Maximum—The maximum (largest value) of the inputs will be calculated.</bullet_item><para/>
        ///     <bullet_item>Median—The median of the inputs will be calculated.</bullet_item><para/>
        ///     <bullet_item>Minimum—The minimum (smallest value) of the inputs will be calculated.</bullet_item><para/>
        ///     <bullet_item>Minority—The minority (value that occurs least often) of the inputs will be calculated.</bullet_item><para/>
        ///     <bullet_item>Range—The range (difference between largest and smallest value) of the inputs will be calculated.</bullet_item><para/>
        ///     <bullet_item>Standard deviation—The standard deviation of the inputs will be calculated.</bullet_item><para/>
        ///     <bullet_item>Sum—The sum (total of all values) of the inputs will be calculated.</bullet_item><para/>
        ///     <bullet_item>Variety—The variety (number of unique values) of the inputs will be calculated.</bullet_item><para/>
        ///   </bulletList>
        ///   <para>The default statistic type is Mean.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定要计算的统计信息类型。</para>
        ///   <bulletList>
        ///     <bullet_item>均值—将计算输入的平均值（平均值）。</bullet_item><para/>
        ///     <bullet_item>多数—将计算输入的大多数（最常出现的值）。</bullet_item><para/>
        ///     <bullet_item>最大值—将计算输入的最大值（最大值）。</bullet_item><para/>
        ///     <bullet_item>中位数—将计算输入的中位数。</bullet_item><para/>
        ///     <bullet_item>最小值—将计算输入的最小值（最小值）。</bullet_item><para/>
        ///     <bullet_item>少数 - 将计算输入的少数（出现频率最低的值）。</bullet_item><para/>
        ///     <bullet_item>范围—将计算输入的范围（最大值和最小值之间的差值）。</bullet_item><para/>
        ///     <bullet_item>标准差—将计算输入的标准差。</bullet_item><para/>
        ///     <bullet_item>总和—将计算输入的总和（所有值的总和）。</bullet_item><para/>
        ///     <bullet_item>多样性—将计算输入的多样性（唯一值的数量）。</bullet_item><para/>
        ///   </bulletList>
        ///   <para>默认统计类型为 Mean。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Overlay statistic")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _statistics_type_value _statistics_type { get; set; } = _statistics_type_value._MEAN;

        public enum _statistics_type_value
        {
            /// <summary>
            /// <para>Mean</para>
            /// <para>Mean—The mean (average) of the inputs will be calculated.</para>
            /// <para>均值—将计算输入的平均值（平均值）。</para>
            /// </summary>
            [Description("Mean")]
            [GPEnumValue("MEAN")]
            _MEAN,

            /// <summary>
            /// <para>Majority</para>
            /// <para>Majority—The majority (value that occurs most often) of the inputs will be calculated.</para>
            /// <para>多数—将计算输入的大多数（最常出现的值）。</para>
            /// </summary>
            [Description("Majority")]
            [GPEnumValue("MAJORITY")]
            _MAJORITY,

            /// <summary>
            /// <para>Maximum</para>
            /// <para>Maximum—The maximum (largest value) of the inputs will be calculated.</para>
            /// <para>最大值—将计算输入的最大值（最大值）。</para>
            /// </summary>
            [Description("Maximum")]
            [GPEnumValue("MAXIMUM")]
            _MAXIMUM,

            /// <summary>
            /// <para>Median</para>
            /// <para>Median—The median of the inputs will be calculated.</para>
            /// <para>中位数—将计算输入的中位数。</para>
            /// </summary>
            [Description("Median")]
            [GPEnumValue("MEDIAN")]
            _MEDIAN,

            /// <summary>
            /// <para>Minimum</para>
            /// <para>Minimum—The minimum (smallest value) of the inputs will be calculated.</para>
            /// <para>最小值—将计算输入的最小值（最小值）。</para>
            /// </summary>
            [Description("Minimum")]
            [GPEnumValue("MINIMUM")]
            _MINIMUM,

            /// <summary>
            /// <para>Minority</para>
            /// <para>Minority—The minority (value that occurs least often) of the inputs will be calculated.</para>
            /// <para>少数 - 将计算输入的少数（出现频率最低的值）。</para>
            /// </summary>
            [Description("Minority")]
            [GPEnumValue("MINORITY")]
            _MINORITY,

            /// <summary>
            /// <para>Range</para>
            /// <para>Range—The range (difference between largest and smallest value) of the inputs will be calculated.</para>
            /// <para>范围—将计算输入的范围（最大值和最小值之间的差值）。</para>
            /// </summary>
            [Description("Range")]
            [GPEnumValue("RANGE")]
            _RANGE,

            /// <summary>
            /// <para>Standard deviation</para>
            /// <para>Standard deviation—The standard deviation of the inputs will be calculated.</para>
            /// <para>标准差—将计算输入的标准差。</para>
            /// </summary>
            [Description("Standard deviation")]
            [GPEnumValue("STD")]
            _STD,

            /// <summary>
            /// <para>Sum</para>
            /// <para>Sum—The sum (total of all values) of the inputs will be calculated.</para>
            /// <para>总和—将计算输入的总和（所有值的总和）。</para>
            /// </summary>
            [Description("Sum")]
            [GPEnumValue("SUM")]
            _SUM,

            /// <summary>
            /// <para>Variety</para>
            /// <para>Variety—The variety (number of unique values) of the inputs will be calculated.</para>
            /// <para>多样性—将计算输入的多样性（唯一值的数量）。</para>
            /// </summary>
            [Description("Variety")]
            [GPEnumValue("VARIETY")]
            _VARIETY,

        }

        /// <summary>
        /// <para>Ignore NoData in calculations</para>
        /// <para><xdoc>
        ///   <para>Specifies whether NoData values will be ignored by the statistic calculation.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—At the processing cell location, if any of the input rasters has NoData, that NoData value will be ignored. The statistics will be computed by only considering the cells with valid data. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—If the processing cell location for any of the input rasters is NoData, the output for that cell will be NoData.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定统计计算是否忽略 NoData 值。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 在处理像元位置，如果任何输入栅格具有 NoData，则将忽略该 NoData 值。将仅考虑具有有效数据的单元格来计算统计数据。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 如果任何输入栅格的处理像元位置为 NoData，则该像元的输出将为 NoData。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Ignore NoData in calculations")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _ignore_nodata_value _ignore_nodata { get; set; } = _ignore_nodata_value._true;

        public enum _ignore_nodata_value
        {
            /// <summary>
            /// <para>DATA</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("DATA")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NODATA</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NODATA")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Process as multiband</para>
        /// <para><xdoc>
        ///   <para>Specifies how the input multiband raster bands will be processed.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Each band from a multiband raster input will be processed separately as a single band raster. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—Each multiband raster input will be processed as a multiband raster. The operation will be performed for each band from one input using the corresponding band number from the other inputs.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何处理输入多波段栅格波段。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中—多波段栅格输入中的每个波段将作为单波段栅格单独处理。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中—每个多波段栅格输入将作为多波段栅格进行处理。将使用来自其他输入的相应频段编号对一个输入的每个频段执行该操作。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Process as multiband")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _process_as_multiband_value _process_as_multiband { get; set; } = _process_as_multiband_value._false;

        public enum _process_as_multiband_value
        {
            /// <summary>
            /// <para>SINGLE_BAND</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("SINGLE_BAND")]
            [GPEnumValue("false")]
            _false,

            /// <summary>
            /// <para>MULTI_BAND</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("MULTI_BAND")]
            [GPEnumValue("true")]
            _true,

        }

        public CellStatistics SetEnv(int? autoCommit = null, object cellSize = null, object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object mask = null, object outputCoordinateSystem = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, cellSize: cellSize, compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, mask: mask, outputCoordinateSystem: outputCoordinateSystem, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}